1. Field of the Invention
The present invention relates to a method and apparatus for deblocking filtering an image, and more particularly, to a method and apparatus for deblocking filtering an image including an encoded block using illumination compensation.
2. Description of the Related Art
In order to encode an image, image compression methods such as MPEG (Moving Picture Expert Group)-1, MPEG-2, MPEG-4, H.264, and MPEG-4 AVC (advanced video coding) divide a picture into a plurality of macroblocks and encode each macroblock using inter prediction or intra prediction.
These image compression methods encode the image into macroblocks, causing blocking artifacts in the restored image. Blocks are discrete cosine transformed and quantized irrespective of correlations between adjacent blocks or pixels, which causes damage to the original image, leading to blocking artifacts.
A deblocking filter reduces this block boundary error and improves the quality of the restored image. This will be described in detail with reference to FIGS. 1A, 1B, and 2.
FIGS. 1A and 1B are block diagrams of conventional image encoding and decoding apparatuses, respectively. These apparatuses perform inter prediction and encode an image, and decode the inter predicted image based on the H.264 standards.
Referring to FIG. 1A, a motion estimator 110 generates a motion vector of a current block that is to be encoded according to reference picture(s) stored in a frame memory 122. A motion compensator 112 generates a prediction block that is a predicted value of the original current block based on the motion vector generated by the motion estimator 110. The motion compensator 112 subtracts the prediction block from the original current block and generates a residue. A discrete cosine transform (DCT) & quantization unit 114 discrete cosine transforms the residue and quantizes the residue. An entropy encoder 116 variable length encodes the quantized residue. The residue encoded by the entropy encoder 116 and the motion vector generated by the motion estimator 110 are inserted into a bit stream and transmitted.
An inverse quantization & inverse DCT unit 118 inverse quantizes and inverse discrete cosine transforms the quantized residue, in order to use the residue to restore the encoded picture.
The residue is added to the prediction block and stored in the frame memory 122 after being deblocking filtered in a deblocking unit 120. If the residue is not deblocking filtered, blocking artifacts occur. A conventional image decoding apparatus will be described with reference to FIG. 1B.
Referring to FIG. 1B, a motion compensator 128 generates a prediction block of an original current block based on data of a motion vector included in a bit stream, by searching a reference picture stored in a frame memory 132.
An entropy decoder 124 receives and entropy decodes the encoded residue. An inverse quantization & inverse DCT unit 126 inverse quantizes and inverse discrete cosine transforms the residue entropy decoded by the entropy decoder 124. The restored residue is added to the prediction block generated by the motion compensator 128 and restored to a block that is not encoded. In the same manner as encoding the image, a deblocking unit 130 deblocking filters the residue to prevent blocking artifacts in the restored block, and stores the residue in the frame memory 132.
FIG. 2 is a flowchart illustrating a conventional deblocking filtering method. The deblocking filtering method performed by the deblocking unit 120 or 130 is defined by the H.264 standards.
Referring to FIG. 2, the deblocking unit 120 or 130 determines whether at least one of two adjacent blocks p and q that are to be deblocking filtered is intra encoded (Operation 201).
In particular, if the deblocking unit 120 or 130 determines that at least one of two adjacent blocks p and q is intra encoded in Operation 201, the deblocking unit 120 or 130 determines whether the two adjacent blocks p and q that are to be deblocking filtered are located at a macroblock boundary (Operation 202). If the deblocking unit 120 or 130 determines that the two adjacent blocks p and q are located at the macroblock boundary in Operation 202, the deblocking unit 120 or 130 sets a filtering intensity of a deblocking filter to the maximum boundary strength (Bs)=4, and deblocking filters the two adjacent blocks p and q (Operation 206). If the two adjacent blocks p and q are not located at the macroblock boundary, the deblocking unit 120 or 130 sets the filtering intensity to Bs=3, and deblocking filters the two adjacent blocks p and q (Operation 207).
If the deblocking unit 120 or 130 determines that the two adjacent blocks p and q are not intra encoded in Operation 201, the deblocking unit 120 or 130 determines whether at least one of the two adjacent blocks p and q has an orthogonal transform coefficient, i.e. a DCT coefficient (Operation 203). If the deblocking unit 120 or 130 determines that at least one of the two adjacent blocks p and q has an orthogonal transform coefficient in Operation 203, the deblocking unit 120 or 130 sets the filtering intensity to Bs=2, and deblocking filters the two adjacent blocks p and q (Operation 208). If the deblocking unit 120 or 130 determines that the two adjacent blocks p and q do not have an orthogonal transform coefficient in Operation 203, Operation 204 is performed.
If the two adjacent blocks p and q do not have an orthogonal transform coefficient in Operation 203, the deblocking unit 120 or 130 determines whether reference frames of the two adjacent blocks p and q differ from each other or the numbers of reference frames of the two adjacent blocks p and q differ from each other, in Operation 204. If the reference frames or the numbers of reference frames differ from each other in Operation 204, the deblocking unit 120 or 130 sets the filtering intensity to Bs=1, and deblocking filters the two adjacent blocks p and q (Operation 209).
If the reference frames or the numbers of reference frames of the two adjacent blocks p and q are identical to each other in Operation 204, the deblocking unit 120 or 130 determines whether motion vectors of the two adjacent blocks p and q differ from each other (Operation 205). If the deblocking unit 120 or 130 determines that the motion vectors of the two adjacent blocks p and q differ from each other in Operation 205, Operation 209 is performed. If the deblocking unit 120 or 130 determines that the motion vectors of the two adjacent blocks p and q do not differ from each other in Operation 205, the deblocking unit 120 or 130 sets the filtering intensity to Bs=0, and does not deblocking filter the two adjacent blocks p and q (Operation 210).
The conventional deblocking filtering method as described in Operations 201 through 210 does not consider encoding of the two adjacent blocks p and q using illumination compensation, which causes blocking artifacts, since a DC value of the current block changes according to whether the two adjacent blocks p and q are encoded using illumination compensation.
Therefore, a method and apparatus for deblocking filtering an image using illumination compensation are needed.